feat: Adds graceful shutdown when INT/TERM/QUIT signal is received#18
Merged
feat: Adds graceful shutdown when INT/TERM/QUIT signal is received#18
Conversation
Member
bougyman
commented
Aug 2, 2025
- refactor: Lowers AbcSize for building workers
- chore: move instance methods to an instance method module and update impacted tests
- feat: Adds Dry::Configurable extension, and makes #logger a configurable setting
- feat: Adds graceful termination of workers
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds graceful shutdown functionality to the NATS API server, allowing it to properly handle INT/TERM/QUIT signals and cleanly terminate workers. It also refactors the codebase by moving instance methods to a dedicated module and introducing Dry::Configurable for better configuration management.
- Adds signal trapping for graceful shutdown of workers and thread pools
- Refactors code by separating instance methods into an
InstanceMethodsmodule - Introduces
Dry::Configurableextension and makes logger configurable
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| lib/leopard/nats_api_server.rb | Implements graceful shutdown, adds instance methods module, and configurable logger |
| test/lib/nats_api_server.rb | Updates test require path and adapts tests for instance method refactoring |
afulki
approved these changes
Aug 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.